#include "messager.h"
#include "ams.h"
#include "log.h"
#include "lvgl.h"
#include "rtc_misc.h"

LV_IMG_DECLARE(icon_cloudy);
ACTIVITY_OPS_IMPLEMENT_DECLARE(weather, &icon_cloudy, ACTIVITY_ATTR_FLAG_APP);

// ##
static void app_gesture_handle(void *event)
{
    ams_gesture_t evt = *((ams_gesture_t *)event);
    switch(evt)
    {
        case GESTURE_SLIDE_TO_TOP:
            break;
        case GESTURE_SLIDE_TO_BOTTOM:
            break;
        case GESTURE_SLIDE_TO_LEFT:
            break;
        case GESTURE_SLIDE_TO_RIGHT:
            ams_switch_by_name("applist", DIR_SLIDE_TO_RIGHT);
            break;
    }
}

// ##
static void app_start(void *content)
{

}

// ##
static void app_stop(void *content)
{

}

// ##
static void app_prepare(void *content)
{
    ams_activity_t *activity = (ams_activity_t *)content;
    AMS_UNUSE(activity);
}

// ##
static void *app_create(void *content)
{
    ams_activity_t *activity = (ams_activity_t *)content;
    activity->ui = lv_obj_create(NULL, NULL);

    static lv_style_t style;
    lv_style_init(&style);

    lv_style_set_text_font(&style, LV_STATE_DEFAULT, &lv_font_montserrat_40);
    lv_style_set_text_color(&style, LV_STATE_DEFAULT, lv_color_hex(0x000000));

    activity->custom = lv_label_create(activity->ui, NULL);
    lv_obj_add_style(activity->custom, LV_LABEL_PART_MAIN, &style);
    lv_label_set_text(activity->custom, "not finished yet");
    lv_obj_align(activity->custom, NULL, LV_ALIGN_CENTER, 0, 0);

    return activity->ui;
}

// ##
static void *app_destroy(void *content)
{
    return NULL;
}

// ##
static void app_event_handle(void *event)
{

}
